-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow using any stage as a startup stage #2248
Conversation
…alias to matching `CoreStage`
This is a bit magical; I'm not sure how I feel about doing all of this implicitly. It will solve the new user confusion there, but I'm a bit nervous about obscuring the correct mental model. |
Yup I think it makes the system much harder to reason about. I think we should consider alternatives, such as:
|
But it was fun magic to write! It completely abuses the dynamic traits we have though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation does look like abuse on a level even greater than the dyn hack itself 😄
Both of the linked problems are, in essence, user errors. I don't think we need any new kind of automagic here: what we have now makes perfect sense once you realise what's going on (i.e. that the startup stage contains the startup schedule with its own stages). So, we just need better docs and a specialized, more descriptive error.
Another idea: |
This solves this specific problem, but it would require hard-coding "startup stage labels" into Schedule right? Not sure I want to compromise a "generic" api for a specific use case. |
Oh. I missed that. Yeah, that idea just went from "ehh" to "no way" in my head. |
I like this a lot as a solution; I think it's much clearer for beginners and doesn't involve any trickery. I don't see any good occasions where end users will want to refer to all startup stages at once in a way that the nested stages encourage. |
Fixes #2246, #2229
add_stage
,add_stage_before
andadd_stage_after
also adds an empty stage with the same label to the startup scheduleCoreStage
are added to the startup scheduleStartupStage
s now work as aliases of matchingCoreStage
s (Startup
->Update
,PreStartup
->PreUpdate
,PostStartup
->PostUpdate
)This means:
StartupStage